package com.android.cs4274;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class Cs4274Activity extends Activity {
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		
		//Intent sender = getIntent();
		//final String serverIP = sender.getExtras().getString("ServerIP");
		
		//final DigitClientAPI test = new DigitClientAPI(Cs4274Activity.this, "hi");

		final Intent intent = new Intent((Context)this, TimeTable.class);
		
		//final ClientInfo client = new ClientInfo();

		final EditText name = (EditText) findViewById(R.id.name);
		Button button = (Button) findViewById(R.id.button1);
		//Dialog dialog = (dialog) findViewById(R.id.)
		button.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
				//client.setName(name.toString());
				intent.putExtra("UserName", name.getText().toString());
				//intent.putExtra("ServerIP", serverIP);
				startActivity(intent);
				//startActivityForResult(intent, 0);	//calling timetable activity
				
				/*
				AlertDialog alertDialog = new AlertDialog.Builder(Cs4274Activity.this).create();
				alertDialog.setMessage("Hello, this is a custom dialog!");
				alertDialog.setCanceledOnTouchOutside(true);
				alertDialog.setButton("Ok", new DialogInterface.OnClickListener(){
					public void onClick(DialogInterface dialog, int which) {
						//od nothing
					}
				});
				alertDialog.show();
				*/

			}
		});




	}
}